package com.books4sale.admin.dto;

import java.util.ArrayList;
import java.util.List;

import javax.jdo.annotations.Element;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;


import com.google.appengine.api.datastore.Key;

@PersistenceCapable(identityType=IdentityType.APPLICATION, detachable = "true")
public class Profile {
	
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key shopId;
	
	@Persistent(mappedBy = "profile")
	@Element(dependent = "true")
	private List<Book> books = new ArrayList<Book>();
	
	private String shopName;
	
	private String shopAddress;
	
	private String shopCity;
	
	private String shopPhone;
	
	private String shopEmail;

	public Key getShopId() {
		return shopId;
	}

	public List<Book> getBooks() {
		return books;
	}

	public String getShopName() {
		return shopName;
	}

	public String getShopAddress() {
		return shopAddress;
	}

	public String getShopCity() {
		return shopCity;
	}

	public String getShopPhone() {
		return shopPhone;
	}

	public String getShopEmail() {
		return shopEmail;
	}

	public void setShopId(Key shopId) {
		this.shopId = shopId;
	}

	public void setBooks(List<Book> books) {
		this.books = books;
	}

	public void setShopName(String shopName) {
		this.shopName = shopName;
	}

	public void setShopAddress(String shopAddress) {
		this.shopAddress = shopAddress;
	}

	public void setShopCity(String shopCity) {
		this.shopCity = shopCity;
	}

	public void setShopPhone(String shopPhone) {
		this.shopPhone = shopPhone;
	}

	public void setShopEmail(String shopEmail) {
		this.shopEmail = shopEmail;
	}
	
	public Profile(Key id, String shopName, String shopAddress, String shopCity,
			String shopPhone, String shopEmail) {
		super();
		this.shopId = id;
		this.shopName = shopName;
		this.shopAddress = shopAddress;
		this.shopCity = shopCity;
		this.shopPhone = shopPhone;
		this.shopEmail = shopEmail;
	}
	
	public Profile() {
		this.shopName = "";
		this.shopAddress = "";
		this.shopCity = "";
		this.shopPhone = "";
		this.shopEmail = "";
	}
	
}
